var Window04 = cc.Class.extend({
	scene: null,
	layer: null,
	tag: null,
	rootNode:null,
	ctor:function (parent, tag) {
		this.tag = tag;
		this.layer = parent;
		this.scene = parent.getParent();
		this.init();
	},
	init:function (){
		this.rootNode = new cc.NodeGrid();
		this.rootNode.setCascadeOpacityEnabled(true);
		this.rootNode.setOpacity(0);
		this.layer.addChild(this.rootNode, 99, this.tag);
		
		this.bg = new cc.Sprite("#lite.png");
		this.bg.setPosition(gg.c_p);
		this.rootNode.addChild(this.bg, 1,TAG_WIN_BG);
		
		this.initSp();
	},
	initSp:function (){
		// 初始化，自定义元素
	},
	open:function(){
		this.rootNode.runAction(cc.fadeIn(0.5));
	},
	close:function(){
		var func = cc.callFunc(this.destroy, this);
		var sequence = cc.sequence(cc.fadeOut(0.5), func);
		this.rootNode.runAction(sequence);
	},
	destroy:function() {
		if(this.closeNext){
			gg.flow.next();
		}
		gg.synch_listener = true;
	},
	closeWin:function(closeNext){
		// 关闭时，是否下一步
		if(closeNext == null){
			this.closeNext = true;
		} else {
			this.closeNext = closeNext;	
		}
		this.close();
	}
})